home *** CD-ROM | disk | FTP | other *** search
/ Experimental BBS Explossion 3 / Experimental BBS Explossion III.iso / msdos / choose21.zip / MM_BRA.SDX < prev    next >
Text File  |  1993-12-15  |  1KB  |  24 lines

  1.                   FLOW CONTROL (BATCH BRANCHING) under CHOOSE
  2.  
  3.     The power of  CHOOSE  results from the ability  to change the course  of
  4.     execution within batch streams via menu selections.   DOS's "ERRORLEVEL"
  5.     is used to effect branching within a batch file.
  6.  
  7.     Whenever a menu selection is made, CHOOSE sets the ERRORLEVEL as follows
  8.     and exits to DOS.
  9.  
  10.                 ERRORLEVEL=3      THIRD to LAST menu selection made
  11.                 ERRORLEVEL=2      SECOND to LAST menu selection made
  12.                 ERRORLEVEL=1      LAST menu selection made
  13.                 ERRORLEVEL=0      ESCAPE struck
  14.  
  15.     BATCH's  "IF ERRORLEVEL="  sub-commands are used following each  CHOOSE
  16.     line to cause the appropriate branching in control flow as shown below.
  17.  
  18.               CHOOSE *** MAIN MENU ***^Windows^WordPerfect^Backup
  19.               IF ERRORLEVEL=3 GOTO :WINDOWS
  20.               IF ERRORLEVEL=2 GOTO :WORD_PROC
  21.               IF ERRORLEVEL=1 GOTO :TAPE_BACKUP
  22.               GOTO :ESC_STRUCK
  23.  
  24.